@using Radzen.Blazor
@using Radzen.Blazor.Rendering
@inherits AxisBase
<CascadingValue Value="@this">
  @ChildContent
</CascadingValue>
@code {
  internal double Measure(RadzenChart chart)
      {
          if (Visible == false)
          {
              return 0;
          }

          if (chart.ShouldInvertAxes())
          {
              return AxisMeasurer.XAxis(chart.ValueAxis.Title);
          }
          else
          {
              return AxisMeasurer.XAxis(Title);
          }
      }

      [Parameter]
      public double Padding { get; set; }

      internal override double Size
      {
          get
          {
              return Measure(Chart);
          }
      }

      protected override void Initialize()
      {
          Chart.CategoryAxis = this;
      }
}
